View Javadoc

1   /*
2    * NOTE - This file has been modified from the original Ant Version.
3    * The Apache licence under which Ant is released is set out below.
4    */
5   
6   /*
7    * Copyright  2002,2004 The Apache Software Foundation
8    *
9    *  Licensed under the Apache License, Version 2.0 (the "License");
10   *  you may not use this file except in compliance with the License.
11   *  You may obtain a copy of the License at
12   *
13   *      http://www.apache.org/licenses/LICENSE-2.0
14   *
15   *  Unless required by applicable law or agreed to in writing, software
16   *  distributed under the License is distributed on an "AS IS" BASIS,
17   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   *  See the License for the specific language governing permissions and
19   *  limitations under the License.
20   *
21   */
22  
23  package org.apache.tools.ant.input;
24  
25  /***
26   * Encapsulates an input request.
27   * Modified for Antigen from the original Ant version
28   *
29   * @version $Revision: 1.2 $
30   * @since Ant 1.5
31   */
32  public class InputRequest {
33      private String prompt;
34      private String input;
35      private String defaul;
36      private String addproperty;
37  
38      /***
39       * @param prompt The prompt to show to the user.  Must not be null.
40       */
41      public InputRequest(String prompt) {
42          if (prompt == null) {
43              throw new IllegalArgumentException("prompt must not be null");
44          }
45  
46          this.prompt = prompt;
47      }
48      /***
49       * @param prompt The prompt to show to the user.  Must not be null.
50       * @param defaul The default value, should no input be entered
51       * @param addproperty
52       */
53      public InputRequest(String prompt, String defaul, String addproperty) {
54          this(prompt);
55          this.defaul = defaul;   
56          this.addproperty = addproperty;
57      }
58      
59  
60      /***
61       * Retrieves the prompt text.
62       */
63      public String getPrompt() {
64          return prompt;
65      }
66  
67      /***
68       * Sets the user provided input.
69       */
70      public void setInput(String input) {
71          this.input = input;
72      }
73      
74      /***
75       * Returns the default prompt
76       */
77      public String getDefault() {
78          return defaul;
79      }
80  
81      /***
82       * Is the user input valid?
83       */
84      public boolean isInputValid() {
85          return true;
86      }
87  
88      /***
89       * Retrieves the user input.
90       */
91      public String getInput() {
92          return input;
93      }
94      
95      /***
96  	 * @return Returns the addproperty.
97  	 */
98  	public String getAddproperty() {
99  		return addproperty;
100 	}
101 }